package org.corey.share.utils;

import java.util.Map;

import com.opensymphony.xwork2.conversion.impl.DefaultTypeConverter;

public class KeywordsTypeConvertor extends DefaultTypeConverter{

	@Override
	public Object convertValue(Map<String, Object> context, Object value,
			Class toType) {
		if(toType==String[].class){
			String[] params=(String[])value;
			String param=params[0];
			return param.split(",");
		}else if(toType==String.class){
			if(value!=null){
				String[] params=(String[])value;
				String returnValue="";
				for(String v:params){
					returnValue+=v;
				}
				return returnValue;
			}
		}
		return null;
	}


}
